public final class Animation {
	public static Animation animations[];
	public boolean aBoolean358;
	public int anInt352;
	public int anInt356;
	public int anInt359;
	public int shield;// 360
	public int weapon;// 361
	public int anInt362;
	public int anInt363;
	public int walkType;// 364
	public int anInt365;
	public int anIntArray353[];
	public int anIntArray354[];
	public int[] anIntArray355;
	public int anIntArray357[];

	public static void unpackConfig(Archive archive) {
		Packet buffer = new Packet(archive.getFile("seq.dat"));
		int length = buffer.getUnsignedShort();
		if (Animation.animations == null) {
			Animation.animations = new Animation[length];
		}
		for (int j = 0; j < length; j++) {
			if (Animation.animations[j] == null) {
				Animation.animations[j] = new Animation();
			}
			Animation.animations[j].readValues(buffer);
		}
	}

	public int method258(int i) {
		int j = anIntArray355[i];
		if (j == 0) {
			FrameReader frameReader = FrameReader.method531(anIntArray353[i]);
			if (frameReader != null) {
				j = anIntArray355[i] = frameReader.delays;
			}
		}
		if (j == 0) {
			j = 1;
		}
		return j;
	}

	private void readValues(Packet buffer) {
		do {
			int i = buffer.getUnsignedByte();
			if (i == 0) {
				break;
			}
			if (i == 1) {
				anInt352 = buffer.getUnsignedByte();
				anIntArray353 = new int[anInt352];
				anIntArray354 = new int[anInt352];
				anIntArray355 = new int[anInt352];
				for (int j = 0; j < anInt352; j++) {
					anIntArray353[j] = buffer.getUnsignedShort();
					anIntArray354[j] = buffer.getUnsignedShort();
					if (anIntArray354[j] == 65535) {
						anIntArray354[j] = -1;
					}
					anIntArray355[j] = buffer.getUnsignedShort();
				}
			} else if (i == 2) {
				anInt356 = buffer.getUnsignedShort();
			} else if (i == 3) {
				int k = buffer.getUnsignedByte();
				anIntArray357 = new int[k + 1];
				for (int l = 0; l < k; l++) {
					anIntArray357[l] = buffer.getUnsignedByte();
				}
				anIntArray357[k] = 0x98967f;
			} else if (i == 4) {
				aBoolean358 = true;
			} else if (i == 5) {
				anInt359 = buffer.getUnsignedByte();
			} else if (i == 6) {
				shield = buffer.getUnsignedShort();
			} else if (i == 7) {
				weapon = buffer.getUnsignedShort();
			} else if (i == 8) {
				anInt362 = buffer.getUnsignedByte();
			} else if (i == 9) {
				anInt363 = buffer.getUnsignedByte();
			} else if (i == 10) {
				walkType = buffer.getUnsignedByte();
			} else if (i == 11) {
				anInt365 = buffer.getUnsignedByte();
			} else if (i == 12) {
				buffer.getInt();
			} else {
				System.out.println("Error unrecognised seq config code: " + i);
			}
		} while (true);
		if (anInt352 == 0) {
			anInt352 = 1;
			anIntArray353 = new int[1];
			anIntArray353[0] = -1;
			anIntArray354 = new int[1];
			anIntArray354[0] = -1;
			anIntArray355 = new int[1];
			anIntArray355[0] = -1;
		}
		if (anInt363 == -1) {
			if (anIntArray357 != null) {
				anInt363 = 2;
			} else {
				anInt363 = 0;
			}
		}
		if (walkType == -1) {
			if (anIntArray357 != null) {
				walkType = 2;
				return;
			}
			walkType = 0;
		}
	}

	private Animation() {
		anInt356 = -1;
		aBoolean358 = false;
		anInt359 = 5;
		shield = -1;
		weapon = -1;
		anInt362 = 99;
		anInt363 = -1;
		walkType = -1;
		anInt365 = 2;
	}
}
